package com.lanyou.esb.datadictionary;

import java.rmi.NoSuchObjectException;

import org.apache.commons.lang3.StringUtils;

/**
 * 告警等级 <br>
 * 描述：<br>
 * 1：一般告警；2：重要告警；3：紧急告警；
 * 
 * @author Davey.wu
 */
public enum AlarmLevel {
	//
	GENERAL("1"), IMPORTANCE("2"), URGENT("3");

	public static final String TypeCode = "20015";

	public final String ValueCode;

	private AlarmLevel(String code) {
		this.ValueCode = code;
	}

	public static AlarmLevel get(String valueCode) throws NoSuchObjectException {
		if (StringUtils.isEmpty(valueCode)) {
			throw new NullPointerException();
		}
		for (AlarmLevel type : AlarmLevel.values()) {
			if (type.ValueCode.equals(valueCode)) {
				return type;
			}
		}
		throw new NoSuchObjectException(valueCode);
	}
}
